package com.tepth.appmanageservice.protocol.packets;

import com.tepth.appmanageservice.protocol.Index;
import com.tepth.appmanageservice.protocol.interfaces.IReceive;
import com.tepth.appmanageservice.protocol.interfaces.ISend;

public class Flag implements IReceive, ISend {
	private byte value;
	private byte[] result;

	public byte getValue() {
		return value;
	}

	public void setValue(byte value) {
		this.value = value;
	}

	@Override
	public short getId() {
		return 0;
	}

	@Override
	public byte[] getResult() {
		return result;
	}

	@Override
	public short getLength() {
		return 1;
	}

	@Override
	public void setLength(int length) {

	}

	@Override
	public void Receive(byte[] data, Index index) {
		setValue(data[index.get()]);
	}

	@Override
	public void load() {
		result = new byte[] { 0x7e };
	}
}